#ifndef ENEMY_FIELD_H

#define ENEMY_FIELD_H

#include "PotentialField.h"

/**
 * This is the EnemyField class. 
 * EnemyField uses the Sensors for detecting Enemies
 * The sensors have a range of 0-360degrees around the car
 * starting with 0-180 and -180-0
 * Between every sensor is 10 degrees
 *
 */

#include <cmath>

enum EnemyStates {
	ENEMY_NONE = 1,
	ENEMY_BEHIND = 2,
	ENEMY_LEFT = 4,
	ENEMY_RIGHT = 8,
	ENEMY_FRONT = 32,
};

class EnemyField : public PotentialField
{
public:
	EnemyField();

	~EnemyField();
	
	/**
	 * Updates all the angles and charges for the EnemyField
	 */
	void update(CarState& cs);

	/**
	 * @ return -	returns the resulting angle calculated by the potentialfield
	 */
	const float getAngle();
	
	const int detectEnemies();

	const float getLengthOfSensors(const int start, const int end);
private:
	float angles[36];
};

#endif
